package com.avocado.configuration.repository;

import org.springframework.data.jpa.repository.Query;

import com.avocado.persistence.repository.BaseRepository;
import com.avocado.configuration.entity.IdGenerator;

public interface IdGeneratorRepository extends BaseRepository<IdGenerator, Long> {
	
	@Query("select count(1) from IdGenerator where genName=?1")
	Long getCountByName(String name);
		
	@Query("select count(1) from IdGenerator where genName=?1 and id!=?2")
	Long getCountByNameAndExcludeId(String name,Long excludeId);

}
